Skip to content

Conversation

@darsnack
Copy link
Contributor

@darsnack darsnack commented Mar 2, 2021

Fixes #25 using the code in #28. Also added tests.

There was some discussion about a rename and default value. I think for the default, we settled on init=Main being fine since it wasn't breaking? We can switch to @__MODULE__ in a breaking release. What about the rename to the argument? Note that it isn't a kwarg, so the name isn't actually typed out by users.

@darsnack
Copy link
Contributor Author

darsnack commented Mar 2, 2021

cc @CarloLucibello

@darsnack
Copy link
Contributor Author

darsnack commented Mar 2, 2021

Looks like the test failures are unrelated to this PR, and they existed on master prior to the change.

@CarloLucibello
Copy link
Collaborator

Note that it isn't a kwarg, so the name isn't actually typed out by users.

in this case init is good enough (I don't have a better suggestion)

@CarloLucibello
Copy link
Collaborator

should this be documented somewhere?

@darsnack
Copy link
Contributor Author

darsnack commented Mar 3, 2021

Since there are no official docs, I added a section to the README.md

@darsnack
Copy link
Contributor Author

darsnack commented Mar 3, 2021

Don't think I have merge rights

@darsnack
Copy link
Contributor Author

darsnack commented Mar 3, 2021

Bump @DhairyaLGandhi ?

Copy link
Collaborator

@DhairyaLGandhi DhairyaLGandhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this. We might be better off using the Module modifier here, but in general I think Main works fine too. We might want to test with using not exported functions/structs from a module to test once

function _raise_recursive(d::AbstractDict, cache, init)
if haskey(d, :tag) && haskey(tags, Symbol(d[:tag]))
cache[d] = tags[Symbol(d[:tag])](applychildren!(x -> raise_recursive(x, cache), d))
if Symbol(d[:tag]) in (:ref, :datatype)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we obviate the need for this check and pass init generically here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would mean every tag[X] needs to be a function of two arguments (d, init) where init is unused for a bunch of cases. Personally, I think the check is cleaner, but I can change it if you like.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it might be polluting, hmm.

The init generally seems to be a way to qualify the symbol anyway. I guess one doesn't usually care beyond a type or global ref.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DhairyaLGandhi so is this okay to keep? If so, I fixed the other comment about the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot round trip custom type (DataFrame) inside a module

4 participants